package com.hx.voice.recognition.auth.client.feign;

import com.hx.voice.recognition.common.msg.ObjectRestResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @descripe：feign调用授权服务端生成token 应用公钥 用户公钥
 * @company：南京华讯方舟通讯设备有限公司
 * @author：zhoujinbing
 * @time：2019/6/11 10:51
 * @version：V1.0
 */
@FeignClient(value = "${auth.serviceId}",configuration = {})
public interface ServiceAuthFeign {

    /**
     * @description 获取允许得客户端
     * @method  getAllowClient
     * @param  [serviceId]
     * @return ObjectRestResponse<java.util.List<java.lang.String>>
     * @date: 2019/6/11 11:07
     * @author:zhoujinbing
     */
    @RequestMapping(value = "/client/myClient",method = RequestMethod.POST)
    public ObjectRestResponse<List<String>> getAllowClient(@RequestParam("serviceId") String serviceId, @RequestParam("secret") String secret);
    /**
     * @description 获取accessToken
     * @method  getAccessToken
     * @param  [clientId,secret]
     * @return ObjectRestResponse<java.util.List<java.lang.String>>
     * @date: 2019/6/11 11:07
     * @author:zhoujinbing
     */
    @RequestMapping(value = "/client/token",method = RequestMethod.POST)
    public ObjectRestResponse getAccessToken(@RequestParam("clientId") String serviceId, @RequestParam("secret") String secret);

    /**
     * @description 获取应用公钥
     * @method  getAllowClient
     * @param  [serviceId]
     * @return ObjectRestResponse<java.util.List<java.lang.String>>
     * @date: 2019/6/11 11:07
     * @author:zhoujinbing
     */
    @RequestMapping(value = "/client/servicePubKey",method = RequestMethod.POST)
    public ObjectRestResponse<byte[]> getServicePubKey(@RequestParam("clientId") String serviceId, @RequestParam("secret") String secret);

    /**
     * @description 获取用户公钥
     * @method  getAllowClient
     * @param  [serviceId]
     * @return ObjectRestResponse<java.util.List<java.lang.String>>
     * @date: 2019/6/11 11:07
     * @author:zhoujinbing
     */
    @RequestMapping(value = "/client/userPubKey",method = RequestMethod.POST)
    public ObjectRestResponse<byte[]> getUserPubKey(@RequestParam("clientId") String serviceId, @RequestParam("secret") String secret);

    






}